import Vue from 'vue'
import Vuex from 'vuex'
import actions from './actions'
import getters from './getters'
import mutations from './mutations'
import { getStore, getStoreStr } from '../utils/storage'
import { ACCESSTOKEN, REFRESHTOKEN, STORE } from './keys'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    accessToken: getStoreStr(ACCESSTOKEN), //访问凭证
    refreshToken: getStoreStr(REFRESHTOKEN), //刷新凭证
    store: getStore(STORE), //商家信息
  },
  actions,
  getters,
  mutations
})
